namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0016 : DbMigration
    {
        public override void Up()
        {
            RenameColumn(table: "dbo.hrm_ps_employees", name: "race_national_seq", newName: "race_nat_seq");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "national_seq", newName: "nat_seq");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "blood_group", newName: "blood_group_seq");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "admitted_date", newName: "date_addmited");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "work_start_date", newName: "date_work_start");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "quit_date", newName: "date_quit");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "probation_end_date", newName: "probation_date_end");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "latest_position_date", newName: "date_latest_pos");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "latest_class_date", newName: "date_latest_class");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "latest_working_job_site_date", newName: "date_latest_working_job_site");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "marital_status_seq", newName: "mar_stat_seq");
            RenameColumn(table: "dbo.mas_religions", name: "name_eng", newName: "religion_name_eng");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "defined_date", newName: "date_defined");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "money_support_date", newName: "date_money_support");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "pos_status_seq", newName: "pos_status");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_code", newName: "job_site_ref");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "name_short", newName: "job_site_name_short");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "name_eng", newName: "job_site_name_eng");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "name_eng_short", newName: "job_site_name_eng_short");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "full_path", newName: "job_site_full_path");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "header_pos_seq", newName: "head_pos_seq");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "web_address", newName: "webaddress");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "name_eng", newName: "exec_pos_name_eng");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "name_short", newName: "exec_pos_name_short");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "name_eng_short", newName: "exec_pos_name_eng_short");
            RenameColumn(table: "dbo.mas_marital_statuses", name: "mar_status_seq", newName: "mar_stat_seq");
            RenameColumn(table: "dbo.mas_marital_statuses", name: "mar_status_name", newName: "mar_stat_name");
            AddColumn("dbo.hrm_mp_job_sites", "address2", c => c.String());
            AddColumn("dbo.IcmMasPurchaseMethod", "AmountMin", c => c.Decimal(nullable: false, precision: 18, scale: 2));
            AddColumn("dbo.IcmMasPurchaseMethod", "AmountMax", c => c.Decimal(nullable: false, precision: 18, scale: 2));
        }
        
        public override void Down()
        {
            DropColumn("dbo.IcmMasPurchaseMethod", "AmountMax");
            DropColumn("dbo.IcmMasPurchaseMethod", "AmountMin");
            DropColumn("dbo.hrm_mp_job_sites", "address2");
            RenameColumn(table: "dbo.mas_marital_statuses", name: "mar_stat_name", newName: "mar_status_name");
            RenameColumn(table: "dbo.mas_marital_statuses", name: "mar_stat_seq", newName: "mar_status_seq");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "exec_pos_name_eng_short", newName: "name_eng_short");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "exec_pos_name_short", newName: "name_short");
            RenameColumn(table: "dbo.hrm_mp_exec_positions", name: "exec_pos_name_eng", newName: "name_eng");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "webaddress", newName: "web_address");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "head_pos_seq", newName: "header_pos_seq");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_full_path", newName: "full_path");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_name_eng_short", newName: "name_eng_short");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_name_eng", newName: "name_eng");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_name_short", newName: "name_short");
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "job_site_ref", newName: "job_site_code");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "pos_status", newName: "pos_status_seq");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "date_money_support", newName: "money_support_date");
            RenameColumn(table: "dbo.hrm_mp_positions", name: "date_defined", newName: "defined_date");
            RenameColumn(table: "dbo.mas_religions", name: "religion_name_eng", newName: "name_eng");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "mar_stat_seq", newName: "marital_status_seq");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_latest_working_job_site", newName: "latest_working_job_site_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_latest_class", newName: "latest_class_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_latest_pos", newName: "latest_position_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "probation_date_end", newName: "probation_end_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_quit", newName: "quit_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_work_start", newName: "work_start_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_addmited", newName: "admitted_date");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "blood_group_seq", newName: "blood_group");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "nat_seq", newName: "national_seq");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "race_nat_seq", newName: "race_national_seq");
        }
    }
}
